CreateCard = function () {

}
CreateCard.prototype = {}

CreateCard.CreateView = function (m_parentDiv, viewName) {
    let m_view = document.createElement('div2');
    m_view.style.position = "fixed";//绝对位置-非常重要的属性 
    m_view.style.top = "20px";
    m_view.style.left = "100px";
    m_view.style.width = "400px";
    m_view.style.height = "600px";
    m_view.style.zIndex = 0;
    m_view.style.backgroundColor = "#776677";
    m_view.style.borderRadius = "2px";//圆角半价
    m_view.style.border = "4px solid #0f1155";//圆角描边颜色
    m_parentDiv["m_" + viewName] = m_view;
    m_parentDiv.appendChild(m_view);
    return m_view;
}

CreateCard.CreateBtn = function (m_parentDiv, name, onClick) {
    let card = document.createElement('a');
    card.style.position = "absolute";//绝对位置-非常重要的属性 
    card.style.top = "2px";
    card.style.left = "2px";
    card.style.width = (name.length * 13) + "px";
    card.style.height = "25px";
    card.style.zIndex = 0;
    card.style.backgroundColor = "#99ffff";
    card.style.color = "#112211";
    card.style.fontSize = "10px";
    card.innerText = name;
    m_parentDiv["m_" + name] = card;
    m_parentDiv.appendChild(card);
    card.onclick = onClick
    return card;
}


//---
//---
//---
//---
//---
//---

//----------创建div-----------------------
function S_creatdiv(parent) {
    let div = document.createElement('div2');
    div.innerText = "div2";
    div.style.position = "absolute";//绝对位置-非常重要的属性
    div.style.top = "10px";
    div.style.left = "20px";
    div.style.width = "100px";
    div.style.height = "30px";
    div.style.zIndex = 0;
    div.style.backgroundColor = "#2e8b57";//div色块颜色
    div.style.borderRadius = "15px";//圆角半价
    div.style.border = "2px solid #0f1155";//圆角描边颜色
    parent.appendChild(div);
    return div;
}

function S_creatInput(parent) {
    let div = document.createElement('input');
    div.innerText = "div2";
    div.style.position = "absolute";//绝对位置-非常重要的属性
    div.style.top = "10px";
    div.style.left = "20px";
    div.style.width = "100px";
    div.style.height = "30px";
    div.style.zIndex = 0;
    div.style.backgroundColor = "#2e8b57";//div色块颜色
    div.style.borderRadius = "15px";//圆角半价
    div.style.border = "2px solid #0f1155";//圆角描边颜色
    parent.appendChild(div);
    return div;
}

function S_creatWeDataField(parent, titleStr, dataStr) {
    //创建li
    var field = document.createElement("div");
    field.style.backgroundColor = "#003355";//field色块颜色
    field.style.position = "absolute";
    parent.appendChild(field);
    //CardDrag_SetDrag(field);

    var text = document.createElement("text");
    field.appendChild(text);
    text.innerHTML = titleStr;
    text.fontSize = "1px";
    text.style.backgroundColor = "#449988";//field色块颜色  
    text.style.position = "absolute";

    var input = document.createElement('input');
    field.appendChild(input);
    // input.setAttribute("type", inputType);
    // input.setAttribute("name", inputName);
    input.value = dataStr;
    input.style.position = "absolute";

    field.m_parent = parent;
    field.m_text = text;
    field.m_input = input;

    field.d_onRefreshSize = function () {
        let field = this;
        let width = field.m_parent.clientWidth;
        let height = 20;
        let titleLen = 30;

        field.style.width = width + "px";
        field.style.height = height + "px";

        field.m_text.style.top = "0px";
        field.m_text.style.left = "0px";
        field.m_text.style.width = titleLen + "px";
        field.m_text.style.height = height + "px";
        field.m_text.style.zIndex = field.style.zIndex + 1;

        field.m_input.style.top = "0px";
        field.m_input.style.left = titleLen + "px";
        field.m_input.style.width = (width - titleLen) + "px";
        field.m_input.style.height = height + "px";
        field.m_input.style.zIndex = field.style.zIndex + 1;
    }
    field.d_onRefreshSize();
    return field;
}